package com.wyy.springbootgraphql.resolver;

import com.wyy.springbootgraphql.beans.Author;
import com.wyy.springbootgraphql.beans.AuthorInput;
import graphql.kickstart.tools.GraphQLMutationResolver;
import org.springframework.stereotype.Service;

//@Service
public class AuthorMutationResolver implements GraphQLMutationResolver {


    public Author addAuthor(AuthorInput authorInput){
        Author newAuthor = new Author();
        newAuthor.setId("001");
        newAuthor.setFirstName(authorInput.getFirstName());
        newAuthor.setLastName(authorInput.getLastName());
        return newAuthor;
    }

}
